<div class="panel">
    <div class="panel-body">
        <table class="table table-striped table-bordered table-response">
            <thead>
                <td ng-repeat="item in data.fieldInfo" ng-show="!item.hided" class="text-center">{{item.comment}}</td>
                <td>编辑</td>
                <td>删除</td>
            </thead>
            <tbody>
                <tr ng-repeat="item in data.datas">
                    <td ng-repeat="list in data.fieldInfo" ng-show="!list.hided" class="text-center">{{item[list.name]}}</td>
                    <td><i class="glyphicon glyphicon-pencil" ng-click="showModal(item)"></i></td>
                    <td><i class="glyphicon glyphicon-minus-sign"></i></td>
                </tr>
            </tbody>
        </table>
    </div>
    <div class="modal fade" tabindex="-1" role="dialog" id="myModal">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">编辑学生数据</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal">
                    <div class=""></div>
                    <div class="form-group" ng-repeat="item in modalData.fieldInfo" ng-if="!item.hided&&item.name!='id'&& item.name!='state' && item.name!='note'  && item.name!='siteId'  && item.name!='createTime'  && item.name!='updateTime'  && item.name!='super'">
                        <label class="control-label col-sm-2">
                            {{item.comment}}
                        </label>
                        <div class="col-sm-10">
                            <input ng-if="item.relDatas==null" class="form-control" type="text" ng-model="modalData.data[item.name]">
                            <!--函数站 select-->
                            <select ng-if="item.name=='stationId'" name="item.name" class="form-control" ng-model="selectedCollection[item.name]" ng-change="change(item.name)">
                                <option value="-1">请选择函授站</option>
                                <option value="{{list.id}}" ng-repeat="list in item.relDatas" 
                                    ng-selected="modalData.data[item.name]==list.id">
                                    {{list.name}}
                                </option>
                            </select>
                            <!--层次 select-->
                             <select ng-if="item.name=='levelId'" name="item.name" class="form-control" ng-model="selectedCollection[item.name]" ng-change="change(item.name)">
                                <option value="-1">请选择{{item.comment}}</option>
                                <option value="{{list.id}}" ng-repeat="list in item.relDatas" ng-selected="modalData.data[item.name]==list.id"
                                    ng-if="selectedCollection.stationId==list.stationId" >
                                    {{list.name}}
                                </option>
                            </select>
                            <!--专业select-->
                             <select ng-if="item.name=='majorId'" name="item.name" class="form-control" ng-model="selectedCollection[item.name]" ng-change="change(item.name)">
                                <option value="-1">请选择{{item.comment}}</option>
                                <option value="{{list.id}}" ng-repeat="list in item.relDatas" ng-selected="modalData.data[item.name]==list.id"
                                    ng-if="
                                        selectedCollection.stationId==list.stationId&&
                                        selectedCollection.levelId==list.levelId" >
                                    {{list.name}}
                                </option>
                            </select>
                            <!--批次 select-->
                             <select ng-if="item.name=='batchId'" name="item.name" class="form-control" ng-model="selectedCollection[item.name]" ng-change="change(item.name)">
                                <option value="-1">请选择{{item.comment}}</option>
                                <option value="{{list.id}}" ng-repeat="list in item.relDatas" ng-selected="modalData.data[item.name]==list.id"
                                    ng-if="
                                        selectedCollection.stationId==list.stationId&&
                                        selectedCollection.levelId==list.levelId&&
                                        selectedCollection.majorId==list.majorId">
                                    {{list.name}}
                                </option>
                            </select>
                            <!--班级 select-->
                            <select ng-if="item.name=='classesId'" name="item.name" class="form-control" ng-model="selectedCollection[item.name]" >
                                <option value="-1">请选择{{item.comment}}</option>
                                <option value="{{list.id}}" ng-repeat="list in item.relDatas"  ng-selected="modalData.data[item.name]==list.id"
                                    ng-if="selectedCollection.stationId==list.stationId&&selectedCollection.levelId==list.levelId&&
                                            selectedCollection.majorId==list.majorId&&
                                        selectedCollection.batchId==list.batchId">
                                    {{list.name}}
                                </option>
                            </select>
                             <select ng-if="item.name=='termId'" name="item.name" class="form-control" ng-model="selectedCollection[item.name]">
                                <option value="">请选择{{item.comment}}</option>
                                <option value="{{list.id}}" ng-repeat="list in item.relDatas" ng-selected="modalData.data[item.name]==list.id">{{list.name}}</option>
                            </select>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="reset" class="btn">重置</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary">提交数据</button>
            </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
</div>
